package com.stary.beetlsql.generator.config;

import com.stary.beetlsql.generator.util.StringUtils;

/**
 * <p>模板配置</p>
 * @author stary {@link stary1993@qq.com}
 * @since 2019-7-31
 */
public class PackageConfig {

	/**
	 * 父包名。如果为空，将下面子包名必须写全部， 否则就只需写子包名
	 */
	private String parent = "com.stary";

	/**
	 * Entity包名
	 */
	private String entity = "entity";

	/**
	 * Service包名
	 */
	private String service = "service";

	/**
	 * Service Impl包名
	 */
	private String serviceImpl = "service.impl";
	/**
	 * Mapper包名
	 */
	private String mapper = "mapper";

	/**
	 * md路径 默认 sql
	 */
	private String mdPath = "sql";

	/**
	 * Controller包名
	 */
	private String controller = "controller";


	public String getParent() {
		return parent;
	}
	
	public PackageConfig setParent(String parent) {
		this.parent = parent;
		return this;
	}

	public String getEntity() {
		return entity;
	}

	public PackageConfig setEntity(String entity) {
		this.entity = entity;
		return this;
	}

	public String getService() {
		return service;
	}

	public PackageConfig setService(String service) {
		this.service = service;
		return this;
	}

	public String getServiceImpl() {
		return serviceImpl;
	}

	public PackageConfig setServiceImpl(String serviceImpl) {
		this.serviceImpl = serviceImpl;
		return this;
	}

	public String getMapper() {
		return mapper;
	}

	public PackageConfig setMapper(String mapper) {
		this.mapper = mapper;
		return this;
	}

	public String getMdPath() {
		return mdPath;
	}

	public PackageConfig setMdPath(String mdPath) {
		this.mdPath = mdPath;
		return this;
	}

	public String getController() {
		if (StringUtils.isEmpty(controller)) {
			return "controller";
		}
		return controller;
	}

	public PackageConfig setController(String controller) {
		this.controller = controller;
		return this;
	}

}
